package com.iflytek.speech;

import com.iflytek.speech.pvc.IPvcListener;

public class libisspvc {
	private static final String tag = "libisspvc";
	private static libisspvc instance = null;

	static {
		System.loadLibrary("isspvc");
	}
	/*回调消息类型*/
	final public static int ISS_PVC_MSG_GetLoginCodeResult = 20001;
	final public static int ISS_PVC_MSG_LoginResult = 20002;
	final public static int ISS_PVC_MSG_LogoutResult = 20003;
	final public static int ISS_PVC_MSG_ListQueryResult = 20004;
	final public static int ISS_PVC_MSG_DownLoadResult = 20005;
	final public static int ISS_PVC_MSG_ListQueryLocalResult = 20006;
	final public static int ISS_PVC_MSG_DelLocalResResult = 20007;
	final public static int ISS_PVC_MSG_DownLoadStart = 20008;
	
	/*参数set or get 类型*/
	final public static String ISS_PVC_PARAM_DEVICEID = "DeviceId";   //设备唯一标识
	final public static String ISS_PVC_PARAM_SAVEDIR = "SaveDir";   //本地音库保存路径
	final public static String ISS_PVC_PARAM_USER = "LoginUser";  //登录用户
	
	public static native synchronized int create(NativeHandle nativeHandle,String resDir, IPvcListener iPvcListener);
	
	public static native synchronized int destroy(NativeHandle nativeHandle);

	public static native synchronized int getLoginCode(NativeHandle nativeHandle,String szPhoneNo);
			
	public static native synchronized int login(NativeHandle nativeHandle,String szPhoneNo, String szCode);
	
	public static native synchronized int logout(NativeHandle nativeHandle);
	
	public static native synchronized int setParam(NativeHandle nativeHandle,String szParam,String szParamValue);  //support ISS_PVC_PARAM_DEVICEID、ISS_PVC_PARAM_SAVEDIR
	
	public static native synchronized String getParam(NativeHandle nativeHandle,String szParam);  //support ISS_PVC_PARAM_DEVICEID、ISS_PVC_PARAM_SAVEDIR、ISS_PVC_PARAM_USER
	
	public static native synchronized int listQuery(NativeHandle nativeHandle);
	
	public static native synchronized int resDownload(NativeHandle nativeHandle,String szVcn);
	
	public static native synchronized int stopRequest(NativeHandle nativeHandle);

	public static native synchronized int listQueryLocal(NativeHandle nativeHandle);
	
	public static native synchronized int delLocalRes(NativeHandle nativeHandle,String szDelList);
}
